<?php

include "functions.lib.php";
include "database.lib.php";
include "classes.php";

session_start();

// local copy
//$db = new MySQLConnection("p:127.0.0.1", "riccardo", "DyuAH2vBVGYYD3Yy", "registro_elettronico");

// seeweb copy
//$db = new MySQLConnection("sql.inrich.it.cloud.seeweb.it", "admin", "oiQu1ea2", "registro_elettronico", "3306");
//$db->set_charset("utf-8");

// keliweb copy
$db = new MySQLConnection("localhost", "rbachisn_reg", "C}iyHFFRX^Pg", "rbachisn_regelett", "3306");
$db->set_charset("utf-8");
//print "Connection ok";

/*inserisco la visita
$page = $_SERVER["SCRIPT_FILENAME"];
$ip = $_SERVER["REMOTE_ADDR"];
$tipo_utente = "anonimo";
$uid = 0;
$uri = $_SERVER["REQUEST_URI"];
if(isset($_SESSION['__uid__'])){
	$uid = $_SESSION['__uid__'];
	if($_SESSION['__parent'] == 1)
		$tipo_utente = "genitore";
	else if($_SESSION['__student__'] == 1)
		$tipo_utente = "studente";
	else
		$tipo_utente = "scuola";
}
$ins = "INSERT INTO visite (data_ora, ip_address, page, utente, tipo_utente, uri) VALUES (NOW(), '$ip', '$page', $uid, '$tipo_utente', '$uri')";
$r_ins = mysql_query($ins);
*/

?>